#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Measure.h>
#include <Unit.h>

USING_MOCKCPP_NS
USING_TESTNGPP_NS

FIXTURE(Measure)
{
	TEST(Measure(LENGTH, 2, MILE) == Measure(LENGTH, 2 * 1760, YARD))
	{
		Measure mile(LENGTH, 2, MILE);
		Measure yard(LENGTH, 2 * 1760, YARD);

		ASSERT_EQ(true, mile == yard);
	}

	TEST(Measure(LENGTH, 3, YARD) == Measure(LENGTH, 3 * 3, FEET))
	{
		Measure yard(LENGTH, 3, YARD);
		Measure feet(LENGTH, 3 * 3, FEET);

		ASSERT_EQ(true, feet == yard);
	}

	TEST(Measure(LENGTH, 4, FEET) == Measure(LENGTH, 4 * 12, INCH))
	{
		Measure feet(LENGTH, 4, FEET);
		Measure inch(LENGTH, 4 * 12, INCH);

		ASSERT_EQ(true, feet == inch);
	}

	TEST(Measure(LENGTH, 5, MILE) == Measure(LENGTH, 5 * 1760 * 3 * 12, INCH))
	{
		Measure mile(LENGTH, 5, MILE);
		Measure inch(LENGTH, 5 * 1760 * 3 * 12, INCH);

		ASSERT_EQ(true, mile == inch);
	}

	TEST(oz(VOLUME, 2, OZ) == tbsp(LENGTH, 2 * 2, TBSP))
	{
		Measure oz(LENGTH, 2, OZ);
		Measure tbsp(LENGTH, 2 * 2, TBSP);

		ASSERT_EQ(true, oz == tbsp);
	}

	TEST(print function)
	{
		Measure length(LENGTH, 35, INCH);
		cout << "35 INCH = " << length;

		Measure length2(LENGTH, 38, INCH);
		cout << "38 INCH = " << length2;

		Measure length3(LENGTH, 48, INCH);
		cout << "48 INCH = " << length3;

		Measure length4(LENGTH, 5, FEET);
		cout << "5 FEET = " << length4;

		Measure length5(LENGTH, 1781, YARD);
		cout << "1781 YARD = " << length5;

		Measure vol1(VOLUME, 135, TBSP);
		cout << "135 TBSP = " << vol1;
		
	}
};

